<?php
/**
 * $Id: default.php 11917 2009-05-29 19:37:05Z ian $
 */
defined( '_JEXEC' ) or die( 'Restricted access' );

$cparams = JComponentHelper::getParams ('com_media');
?>
<script type="text/javascript">
$(document).ready(function(){	
     reset_contact=function(){
     //e.preventDefault(); 
	 //alert("aaaaaaa");
     $("#email").attr("value","");
     $("#name").attr("value","");
     $("#subject").attr("value","");
     $("#text").attr("value","");
     return false;
	 };
    });
</script>

<script type="text/javascript">
	$(document).ready(function(){
	
    check_contact=function(){
        
        if(($('#name').attr("value") == "" )){
            $('#alert').html('Udfyld venligst Din Navn ');
            $('#backoverlay').show();
            $('#show_popup').show();
            $('#f_focus').html('name');
            return false;	
        }
        
        if(($('#email').attr("value") == "" )){
		//alert("aaaa");
            $('#alert').html('Udfyld venligst email');
            $('#backoverlay').show();
            $('#show_popup').show();
            $('#f_focus').html('email');
            return false;	
        }
        
        else{
            if(!isEmail($('#email').val())){
                $('#alert').html('Venligst e-mail er gyldig');
                $('#backoverlay').show();
                $('#show_popup').show();
                $('#s_focus').html('email');
                return false; 
            }
        }
             		
      if(($('#text').attr("value") == "")){
			$('#alert').html('Udfyld venligst din besked');
            $('#backoverlay').show();
			$('#show_popup').show();
			$('#f_focus').html('text');
			return false;	
		}
            
        //$('#com_form_login').submit();
        $('#send_contact').click();
        
        return true;
	};    
     isEmail=function(string) {
		if (string.search(/^\w+((-\w+)|(\.\w+)|(\_\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
			return true;
		else return false;
    };
    close_popup=function(){		
		var fel=$('#f_focus').html();
        $('#backoverlay').hide();
		$('#show_popup').hide();
		$('#' + fel ).focus();
	};
    
    });

</script> 
 <div id="main">
	<!--left sidebar-->
	<div class="aside">
		<div class="contact-info">
			<h2>Firma infomation</h2>
		   {module Firma infomation}
		</div>
		<div class="corp-links">
		  
			{module Corporate links}
		</div>
	</div>
	<!-- Begin main-content  -->
	<div id="content" class="with-sidebar">
		<h1 class="page-title">KONTAKT OS</h1>
		<!-- Begin service content  -->
		<div class="content-ctn">
			<div class="sub-banner"><img src="templates/bookrengoring/img/contact_banner.jpg" alt="SG Gruppen Service" /></div>
			<div class="contact-form">
				<h2>Kontakt Formular</h2>
				<div class="form-ctn grid-bg">
					<form  action="<?php echo JRoute::_('index.php') ?>" id="contactForm" name="contactForm" method="post">
						<fieldset>
							<div class="input-set">
								<label>Din Navn<span>*</span></label>
								<input class="input-txt" type="text" id="name" name="name" value="" />
								<label>Email<span>*</span></label>
								<input class="input-txt" type="text" id="email" name="email" value="" />
								<label>Emne</label>
								<input class="input-txt" type="text" id="subject" name="subject" value="" />
								<label>Besked<span>*</span></label>
								<textarea rows="20" cols="20"  name="text" id="text"></textarea>
								<p class="note">* <em> Skal udfyldes</em></p>
							</div>
							<div class="form-submit">																			
								<a class="send-btn fl-left" onclick="check_contact();" href="javascript:void(0);">Send</a>
								<input type="submit" value="send_contact" id="send_contact" name="send_contact" style="display:none;" />
								<a class="reset-btn fl-left" id="reset" onclick="reset_contact();" href="javascript:void(0);" >Nustil</a>
								<input type="submit" value="send_contact" id="send_contact" name="send_contact" style="display:none;" />
								
							 </div>
						</fieldset>
						   <input type="hidden" name="option" value="com_contact" />
							<input type="hidden" name="view" value="contact" />
							<input type="hidden" name="id" value="<?php echo $this->contact->id; ?>" />
							<input type="hidden" name="task" value="submit" />
							<?php echo JHTML::_( 'form.token' ); ?>
					</form>
				</div>
			</div>
		</div>
		<!-- / service content  -->
		
	</div>
	<!-- / main-content  -->
	  
	<!-- /end mid-content  -->
</div>

